Is it possible to export OLE to a file?

Using DOORS 9.2 ( and soon 9.4), and I have been asked if it is possible to open up a module, and at a specific heading, go to the next step and export that to a file.

This information is placed into the Test Comment column via Word as an OLE.
I have written scripts to pull out certain text in the Test Comment column, so I know how to write plain text to a file.

I am wondering if I can just write the OLE to a file, or is there something more that I need to do?

Thank you.
Gedinfo - Thu Aug 16 16:54:31 EDT 2012

Re: Is it possible to export OLE to a file?
Mathias Mamsch - Fri Aug 17 03:35:58 EDT 2012

Well the question is what you want to do with the file? You could write the RTF of the object text to a plain text file and open it up with an RTF reader. You can also export the picture of the OLE object to a picture file. So what kind of file are we talking about? Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Is it possible to export OLE to a file?
Gedinfo - Fri Aug 17 07:13:21 EDT 2012

Mathias Mamsch - Fri Aug 17 03:35:58 EDT 2012
Well the question is what you want to do with the file? You could write the RTF of the object text to a plain text file and open it up with an RTF reader. You can also export the picture of the OLE object to a picture file. So what kind of file are we talking about? Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

At this point, my manager would like to have this OLE(originally created in Word), to be exported to Word.

Re: Is it possible to export OLE to a file?
llandale - Fri Aug 17 11:31:46 EDT 2012

I see this command and constants:

string      exportPicture(EmbeddedOleObject,string fileName,int format)
        int     formatBMZ
        int     formatWMZ
        int     formatEMF
        int     formatEMZ
        int     formatRLE
        int     formatTIF
        int     formatTIFF
        int     formatGIF
        int     formatJPE
        int     formatJFIF
        int     formatJPG
        int     formatJPEG
        int     formatUNKNOWN
        int     formatEPSF
        int     formatWMF
        int     formatDIB
        int     formatBMP
        int     formatPNG_
        int     formatPNG


So perhaps something like this works:

 

string TextRich = richTextWithOle(obj."Object Text")
string ErrMess, NameFile = "c:/WhereEver/WhatEver.ole"
RichText rt
EmbeddedOleObject eoo
 
for rt in TextRich do
{  if (!rt.ole)    continue
   eoo = rt.getEmbeddedOle
   if (null eoo) continue
   ErrMess = exportPicture(eoo,NameFile,formatLouieDoesn'tKnow)
   bla bla bla
}


-Louie

 

Re: Is it possible to export OLE to a file?
Gedinfo - Thu Aug 23 16:36:56 EDT 2012

This is the way that I can describe exactly what I wish to do:

In a DOORS module:
1. Highlight the Test Comment section until the cursor appears.
2. Click on Insert, then select OLE Object...
3. Select Microsoft Word Document, then click OK.
Now, Citrix Word opens.
4. Open Word 2010, and copy a table.
5. Go back to Citrix Word, then paste.
6. Click on X to close Citrix Word.

Is there a way to reverse this process?

I search in the module for a specific header, which always contains an OLE object one step below.
I wish to be able to copy the OLE object, and import it back into Word 2010.

Re: Is it possible to export OLE to a file?
Mathias Mamsch - Thu Aug 23 18:02:00 EDT 2012

Gedinfo - Thu Aug 23 16:36:56 EDT 2012
This is the way that I can describe exactly what I wish to do:

In a DOORS module:
1. Highlight the Test Comment section until the cursor appears.
2. Click on Insert, then select OLE Object...
3. Select Microsoft Word Document, then click OK.
Now, Citrix Word opens.
4. Open Word 2010, and copy a table.
5. Go back to Citrix Word, then paste.
6. Click on X to close Citrix Word.

Is there a way to reverse this process?

I search in the module for a specific header, which always contains an OLE object one step below.
I wish to be able to copy the OLE object, and import it back into Word 2010.

Correct me if I am wrong, but it sounds a little bit like what every word exporter does - only that you do not want the embedded word object in your word document, but its contents? WEXP (Word Exporter) has such a functionality, if you are interested and do not have the sourcecode yourself, I can send you the relevant part. Or do I get this wrong? Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Is it possible to export OLE to a file?
Gedinfo - Fri Aug 24 07:28:31 EDT 2012

Mathias Mamsch - Thu Aug 23 18:02:00 EDT 2012
Correct me if I am wrong, but it sounds a little bit like what every word exporter does - only that you do not want the embedded word object in your word document, but its contents? WEXP (Word Exporter) has such a functionality, if you are interested and do not have the sourcecode yourself, I can send you the relevant part. Or do I get this wrong? Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Mathias,
Yes, that is what I am looking for. I have been unable to find WEXP.
Could you please send me the source code?

Thank you

Re: Is it possible to export OLE to a file?
mcnairk - Mon Aug 27 15:13:06 EDT 2012

Gedinfo - Fri Aug 24 07:28:31 EDT 2012
Mathias,
Yes, that is what I am looking for. I have been unable to find WEXP.
Could you please send me the source code?

Thank you

I'm told this version works in DOORS 9.1, but I'm not sure about 9.2...

Ken.
Attachments

attachment_14879760_TWEXP_for_DOORS_9_1_Encoded.zip

Re: Is it possible to export OLE to a file?
lahines - Mon Aug 27 15:51:27 EDT 2012

Just curious, why do you need to export the OLE file. Double click to activate and save to another file name, or copy from the properties window.

Re: Is it possible to export OLE to a file?
Gedinfo - Mon Aug 27 15:54:25 EDT 2012

lahines - Mon Aug 27 15:51:27 EDT 2012
Just curious, why do you need to export the OLE file. Double click to activate and save to another file name, or copy from the properties window.

Louie, Yes, your suggestion will work on a single module, but I wish to set this up to go through all modules in a directory without any intervention and put the objects into a Word document.

Re: Is it possible to export OLE to a file?
Mathias Mamsch - Tue Aug 28 08:53:52 EDT 2012

Gedinfo - Mon Aug 27 15:54:25 EDT 2012
Louie, Yes, your suggestion will work on a single module, but I wish to set this up to go through all modules in a directory without any intervention and put the objects into a Word document.

I think the relevant code from the free wexp is
 

// ... above here WEXP, copy pasted all OLEs into the word document ...
// ... the unpacking of embedded word objects in word will happen in Word ...
 
for i in 1:numOLEs do {
   // go backward to next field (embedded OLEs are fields in word)
   WEXP_objWord."Application"."Browser"<-"Target" = wdBrowseField
   WEXP_objWord."Application"."Browser"->"Previous"
 
   // select the field
   WEXP_objSel->"MoveRight"("Unit"<-wdCharacter) ("Count"<-1) ("Extend"<-wdExtend)
 
 
   // get a handle to the field
   OleAutoObj fieldObj = (WEXP_objSel."Fields")[1]
   if ( null fieldObj ) break
 
   // Check if it is an embedded OLE object
   fieldObj->"Select"
   bool isOLE = WEXP_find("EMBED")
   fieldObj->"Select"
 
 
   if ( isOLE ) {
      bool isWordOLE = WEXP_find("Word.Doc")
      fieldObj->"Select"
 
      // get a handle on the embedded OLE object
      OleAutoObj oleObj = (WEXP_objSel."InlineShapes")[1]
      if ( null oleObj ) break
 
      // if this object should be 'inlined' = unpacked ...
      if ( probeAttr_(o, AOLEINLINE) == "True" && isWordOLE ) {
         // activate it and get a handle on the active Document
         oleObj->"Activate"
         OleAutoObj oleDoc = WEXP_objWord."ActiveDocument"
         WEXP_checkResult(oleDoc, "Unable to get active document containing OLE")
         
         // ... select everything in the embedded word ...
         OleAutoObj this_objSel = WEXP_objWord."Selection"
         this_objSel->"WholeStory"
         // ... copy it ...
         this_objSel->"Copy"
 
         // now active the original document, close the embedded one and then paste the contents
         WEXP_objDoc->"Activate"
         WEXP_objSel = WEXP_objWord."Selection"
 
         oleDoc->"Close"
         WEXP_objSel->"Paste"
 
         WEXP_closeIfNonNull(oleDoc)
         WEXP_closeIfNonNull(this_objSel)
     } else { 
         ....
     } // end if ( isOLE )
} // end for i in 1:numOLEs do

 


Of course you can do the same not inside of word, but active the document in DOORS directly and copy/paste the contents to a word document, you can also unpack them later in a VBA macro, that you let run over the complete word document. Maybe that helps, regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Is it possible to export OLE to a file?
shrunavi - Wed Oct 11 05:48:04 EDT 2017

Hi,

 

Can we export the OLE to excel, the ole is in word format and the ole image is tables which i want to export to excel and edit it?

And also is it possible to extract the contents of the OLE image which is (PPt)?

 

Regards,

Shruthi

Re: Is it possible to export OLE to a file?
DXLAdimn - Thu Mar 01 01:02:25 EST 2018

Hi,

How to export an OLE from an embedded word file of an attribute column into an object of main column in a module?

In a module:
1. Created an attribute of type text to store the embedded word file.
2. Click on Insert, then select OLE Object...
3. Select Microsoft Word Document display as Icon and written some text then click OK.

 

Now I need dxl code to export the content from the embedded word file into object of main column.

 

Thanks,

Naidu
 

Re: Is it possible to export OLE to a file?
Mathias Mamsch - Thu Mar 01 05:06:55 EST 2018

DXLAdimn - Thu Mar 01 01:02:25 EST 2018

Hi,

How to export an OLE from an embedded word file of an attribute column into an object of main column in a module?

In a module:
1. Created an attribute of type text to store the embedded word file.
2. Click on Insert, then select OLE Object...
3. Select Microsoft Word Document display as Icon and written some text then click OK.

 

Now I need dxl code to export the content from the embedded word file into object of main column.

 

Thanks,

Naidu
 

Do not pull answered posts, by adding another (possibly unrelated question). People spending time on the forum for other users do not want to spend their time looking for unanswered question inside an answered post. Instead open a new post and refer to the other post if you think it is relevant to your question. Additionally: Questions that end with "I need DXL code ..." are usually frowned upon. You need to state a specific problem and show that you did some research on your question for people to be willing to answer. Regards, Mathias